<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>班级管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#btnExport").click(function(){
			top.$.jBox.confirm("确认要导出班级数据吗？","系统提示",function(v,h,f){
				if(v=="ok"){
					$("#searchForm").attr("action","${ctx}/dd/ddClasses/export");
					$("#searchForm").submit();
				}
			},{buttonsFocus:1});
			top.$('.jbox-body .jbox-icon').css('top','55px');
		});
		$("#btnImport").click(function(){
			$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
				bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
		});
	});
		function page(n,s){
			if(n) $("#pageNo").val(n);
			if(s) $("#pageSize").val(s);
			$("#searchForm").attr("action","${ctx}/dd/ddClasses/list");
			$("#searchForm").submit();
	    	return false;
	    };
	    function setDowmUrl(){
			var url='${ctxStatic}'+"/xls/班级表.xlsx";
			location.href =url;
	    };
	</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/dd/ddClasses/import" method="post" enctype="multipart/form-data"
			class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<%-- <a href="${ctx}/dd/ddStudent/import/template">下载模板</a> --%>
				<a id="dowmTable" href="javascript:;" onclick="setDowmUrl();">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/dd/ddClasses/">班级列表</a></li>
		<shiro:hasPermission name="dd:ddClasses:edit"><li><a href="${ctx}/dd/ddClasses/form">添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="ddClasses" action="${ctx}/dd/ddClasses/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		<li><label>班级：</label>
		<form:input path="classes" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
			<input id="btnImport" class="btn btn-primary" type="button" value="导入"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>班级</th>
				<th>年级</th>
				<th>类别</th>
				<th>教室</th>
				<!-- 显示修改时间列 -->
				<!-- <th>update_date</th> -->
				<shiro:hasPermission name="dd:ddClasses:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="ddClasses">
			<tr>
				<td><a href="${ctx}/dd/ddClasses/form?id=${ddClasses.id}">
				${ddClasses.classes}
				</a></td>
				<td>
				${fns:getDictLabel(ddClasses.grade, 'grade','')}
				</td>
				<td>
					${fns:getDictLabel(ddClasses.category, 'category','')}
				</td>
				<td>
				${ddClasses.classroomName}
				</td>
				<shiro:hasPermission name="dd:ddClasses:edit"><td>
    				<a href="${ctx}/dd/ddClasses/form?id=${ddClasses.id}" title="修改">修改</a>
					<a href="${ctx}/dd/ddClasses/delete?id=${ddClasses.id}" onclick="return confirmx('确认要删除该单表吗？', this.href)" title="删除">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>